<template>
	<view class="max-box">
		<view class="header">
			<image src="@/static/logo.png" class="header-image" mode=""></image>
			<view class="">点击修改头像</view>
		</view>
		<view class="main">
			<view class="main-content" @click="name = true">
				<view class="">
					<text>昵称</text>
					<text class="my-name">设备地道口</text>
				</view>
				<u-icon name="arrow-right" size="23"></u-icon>
			</view>
			<u-popup :show="name" mode="center" :round="10" @close="close">
				<view class="name-popup">
					<u-icon class="shut-down" name="close" size="28" @click="name = false"></u-icon>
					<u--form labelPosition="left" :model="userForm" :rules="rules" ref="uForm">
						<u-form-item label="新昵称" labelWidth="80" prop="userInfo.name" borderBottom ref="item1">
							<u--input class="input" v-model="userInfo.name" placeholder="请输入新的昵称" border="none"></u--input>
						</u-form-item>
						<button class="name-button">确定</button>
					</u--form>
				</view>
			</u-popup>
			<u-line type="info"></u-line>
			<view class="main-content" @click="gender = true">
				<view class="">
					<text>性别</text>
					<text class="my-name">男</text>
				</view>
				<u-icon name="arrow-right" size="23"></u-icon>
			</view>
			<u-picker :show="gender" :columns="sex" @close="gender = false" @cancel="gender = false" closeOnClickOverlay></u-picker>
			<u-line type="info"></u-line>
			<view class="main-content">
				<view class="">
					<text>手机号</text>
					<text class="my-name">未绑定</text>
				</view>
				<u-icon name="arrow-right" size="23"></u-icon>
			</view>
			<u-line type="info"></u-line>
			<view class="main-content">
				<text>服务协议</text>
				<u-icon name="arrow-right" size="23"></u-icon>
			</view>
			<u-line type="info"></u-line>
			<view class="main-content">
				<text>隐私政策</text>
				<u-icon name="arrow-right" size="23"></u-icon>
			</view>
			<u-line type="info"></u-line>
			<view class="main-content">
				<text>资质信息</text>
				<u-icon name="arrow-right" size="23"></u-icon>
			</view>
			<u-line type="info"></u-line>
			<view class="main-content">
				<text>关于我们</text>
				<text>v2.2.0.20230220</text>
			</view>
		</view>
		<view class="footer">
			<view>Copyright @ 2019-2021 软件开发</view>
			<view>蜀ICP证000000号</view>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				// name弹出层
				name: false,
				// 昵称点击之后的表单v-model绑定数据
				userForm: {
					name: '',
				},
				// 昵称表单检验
				rules: {
					name: {
						type: 'string',
						required: true,
						message: '请填写姓名',
						trigger: ['blur', 'change']
					}
				},
				// 控制性别选择框显示与隐藏
				gender:false,
				// 性别选择器数据
				sex:[
					['男','女']
				]

			}
		},
		methods: {
			// 名字弹出层事件
			close() {
			        this.show = false
			        // console.log('close');
			      }
		}
	}
</script>

<style scoped lang="scss">
	.max-box {
		height: 1440rpx;
		background-color: rgb(246, 246, 246);
	}

	.header {
		background-color: #fff;
		padding: 20rpx 20rpx 20rpx 20rpx;
		display: flex;
		flex-direction: column;
		align-items: center;
	}

	.header-image {
		width: 125rpx;
		height: 125rpx;
		border-radius: 100%;
		margin-bottom: 20rpx;
	}

	.main {
		background-color: #fff;
		padding: 60rpx 20rpx 20rpx 20rpx;
	}

	.main-content {
		display: flex;
		justify-content: space-between;
		align-items: center;
		font-size: 40rpx;
		padding: 30rpx 20rpx 30rpx 20rpx;
	}

	.my-name {
		margin-left: 80rpx;
	}

	.footer {
		margin-top: 80rpx;
		text-align: center;
		color: #ccc;
	}
	.name-popup{
		width: 600rpx;
		padding: 20rpx 20rpx 20rpx 20rpx;
		::v-deep .u-icon--right.data-v-172979f2 {
		    flex-direction: row;
		    align-items: center;
		    width: 80rpx;
		    margin: 0 0 0 533rpx;
		}
	}
	.shut-down{
		margin-left: 40rpx;
		width: 30rpx;
	}
	.name-button{
		width: 500rpx;
		background-color: rgb(255, 44, 60);
		color: #fff;
		border-radius: 20rpx;
		margin-top: 40rpx;
	}
</style>